//
//  WBNavigationBar.swift
//  Swift微博
//
//  Created by 汪大强 on 2018/7/19.
//  Copyright © 2018年 汪大强. All rights reserved.
//

import UIKit

class WBNavigationBar: UINavigationBar {
    // 重写父类的 layoutSubviews
    override func layoutSubviews() {
        super.layoutSubviews()
        for subView in self.subviews {
            let stringFromClass = NSStringFromClass(subView.classForCoder)
            if stringFromClass.contains("BarBackground") {
                subView.frame = self.bounds
            } else if stringFromClass.contains("UINavigationBarContentView"){
                subView.frame = CGRect(x: 0, y: 20, width: UIScreen.cz_screenWidth(), height: 44)
            }
        }
    }
}
